/**
 * @file userApp.h
 * @author your name (you@domain.com)
 * @brief
 * @version 0.1
 * @date 2022-10-20
 *
 * @copyright Copyright (c) 2022
 *
 */

#ifndef __USER_APP_H__
#define __USER_APP_H__

#include "bcomdef.h"
#include "ll_def.h"
#include "comdef.h"

#ifdef __cplusplus
extern "C"
{
#endif
#define UserAppEvent_POWER_ON           0x0001
#define UserAppEvent_POWER_OFF          0x0002
#define UserAppEvent_INIT_FACTORY       0x0004      // 恢复出厂设置
#define UserAppEvent_ReadHistory        0x0008      // 读取历史记录
#define UserAppEvent_ReflashRTC         0x0010      // 定时刷新RTC时间
#define UserAppEvent_PROCESS            0x0020
#define UserAppEvent_TimeClrKey         0x0040
#define UserAppEvent_ReadFlash          0x0080
#define UserAppEvent_Bz                 0x0100
#define UserAppEvent_Adc                0x0200
//---------------------------------------------------------
#ifndef UTC_1970TO2000_SECOND
#define UTC_1970TO2000_SECOND 0x386D4380
#endif
//---------------------------------------------------------
extern uint8_t UseAPP_TaskID;
//----------------------------------------------------------
#ifndef USER_TASK_START
#define USER_TASK_START 0
#define USER_TASK_STOP 1
#endif
//----------------------------------------------------------
#define PUMP_Ctl_PIN	        P18
//----------------------------------------------------------
void UserAppPrcess_Init(uint8 task_id);
uint16 UserApp_ProcessEvent(uint8 task_id, uint16 events);
void useApp_task_set(uint8 action, uint16 event, uint32 time);
//----------------------------------------------------------

#ifdef __cplusplus
}
#endif

#endif
